﻿using UnityEngine;

namespace Code.CharacterSystem
{
    public class PlayerController:MonoBehaviour
    {
        private Player _player;
        private void Awake()
        {
            _player=GetComponent<Player>();
        }

        private void Update()
        {
            float inputX = Input.GetAxis("Horizontal");
            float inputY = Input.GetAxis("Vertical");
            _player.Move(new Vector2(inputX,inputY));
            if (Input.GetKeyDown(KeyCode.Space)) 
            {
                _player.Attack();
            }
        }
    }
}
